package com.cj;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * @author cc
 * @date 2025-05-14 10:23
 **/
@Configuration
@PropertySource("classpath:db.properties")
public class JavaConfig {

    @Value("${db.username}")
    String username;
    String password;

    @Bean
    public DataSource dataSource(){
        DataSource ds = new DataSource();
        ds.setUsername(username);

        return ds;
    }

}
